function getAge(birthday) {
	let age = 0
	let birthdayArr = birthday.split("-")
	let birthYear = birthdayArr[0]
	let birthMonth = birthdayArr[1]
	let birthDay = birthdayArr[2]

	let now = new Date();
	var nowYear = now.getFullYear()
	var nowMonth = now.getMonth() + 1
	var nowDay = now.getDate()

	if (nowYear == birthYear) {
		age = 0; //同年 则为0岁  
	} else if (nowYear > birthYear) {
		let ageDiff = nowYear - birthYear; //年之差
		if (nowMonth == birthMonth) {
			let dayDiff = nowDay - birthDay; //日之差  
			if (dayDiff < 0) {
				age = ageDiff - 1;
			} else {
				age = ageDiff;
			}
		} else {
			let monthDiff = nowMonth - birthMonth; //月之差  
			if (monthDiff < 0) {
				age = ageDiff - 1;
			} else {
				age = ageDiff;
			}
		}
	} else {
		age = -1;
	}
	return age; //返回周岁年龄  
}

export default getAge